package com.example.redisdemo.util;

import com.example.redisdemo.interfacer.impl.UUIDGeneralSerial;
import com.example.redisdemo.webrtc.message.Message;
import org.springframework.beans.BeanUtils;
import org.springframework.util.ClassUtils;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * 各种工具使用使用
 *
 * @author hexinglin
 * @created 2022-06-09 14:02
 **/
public class DemoUtils {
    public static void main(String[] args) {
//        Class<?>[] allInterfaces = ClassUtils.getAllInterfaces(new UUIDGeneralSerial());
//        System.out.println(allInterfaces);

//        Method declaredMethod = BeanUtils.findDeclaredMethod(Message.class, "getOperation");
//        System.out.println(declaredMethod.getName());

       /* List<Integer> list = new ArrayList<>();
        list.add(2);
        list.add(1);
        list.add(3);
        list.add(2);
        Collections.sort(list);//升序
        System.out.println(list);
        Collections.reverse(list);//降序
        System.out.println(list);
        int i = Collections.binarySearch(list, 3);//二分查找
        System.out.println(list.get(i) );*/

    }

}
